# -*- coding: utf-8 -*-

# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
from baidustock.models.baidu_stock_info_table import BaiduStockInfoTable


class BaiduPipeline(object):
    def process_item(self, item, spider):
        # insert()为类方法，不需要实例化即可直接调用
        BaiduStockInfoTable.insert(BaiduStockInfoTable(**item))
        return item
